import request from '@/utils/request'

export function getAttatchment(id) {
  return request({
    url: 'api/tAttachment?attatchmainkey=' + id,
    method: 'get'
  })
}

export function getAttatchFile(fileName) {
  return request({
    url: 'api/tAttachmentFile?fileName='+fileName,
    method: 'get'
  })
}

export function add(data) {
  return request({
    url: 'api/tAttachment',
    method: 'post',
    data
  })
}

export function delAttatchment(id) {
  return request({
    url: 'api/tAttachment/' + id,
    method: 'delete'
  })
}

export function edit(data) {
  return request({
    url: 'api/tAttachment',
    method: 'put',
    data
  })
}
